﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FooFun.GrantFrameworks;

namespace AccessGrant
{
    public class DicMatrix : IMatrix<PermissionSet, int, int>
    {
        Dictionary<string, PermissionSet> dic;

        public DicMatrix()
        {
            dic = new Dictionary<string, PermissionSet>();
        }

        #region IMatrix<PermissionSet,int,int> 成员

        public PermissionSet this[int x, int y]
        {
            get
            {
                return dic[GetKey(x, y)];
            }
            set
            {
                dic[GetKey(x, y)] = value;
            }
        }

        #endregion

        private string GetKey(int x, int y)
        {
            string key = x + "_" + y;

            return key;
        }
    }
}
